package com.openbravo.pos.payment;

public class PaymentInfoMagcard extends PaymentInfo
{
  protected double m_dTotal;
  protected String m_sHolderName;
  protected String m_sCardNumber;
  protected String m_sExpirationDate;
  protected String track1;
  protected String track2;
  protected String track3;
  protected String m_sTransactionID;
  protected String m_sAuthorization;
  protected String m_sErrorMessage;
  protected String m_sReturnMessage;

  public PaymentInfoMagcard(String paramString1, String paramString2, String paramString3, String paramString4, String paramString5, String paramString6, String paramString7, double paramDouble)
  {
    this.m_sHolderName = paramString1;
    this.m_sCardNumber = paramString2;
    this.m_sExpirationDate = paramString3;
    this.track1 = paramString4;
    this.track2 = paramString5;
    this.track3 = paramString6;
    this.m_sTransactionID = paramString7;
    this.m_dTotal = paramDouble;
    this.m_sAuthorization = null;
    this.m_sErrorMessage = null;
    this.m_sReturnMessage = null;
  }

  public PaymentInfoMagcard(String paramString1, String paramString2, String paramString3, String paramString4, double paramDouble)
  {
    this(paramString1, paramString2, paramString3, null, null, null, paramString4, paramDouble);
  }

  public PaymentInfo copyPayment()
  {
    PaymentInfoMagcard localPaymentInfoMagcard = new PaymentInfoMagcard(this.m_sHolderName, this.m_sCardNumber, this.m_sExpirationDate, this.track1, this.track2, this.track3, this.m_sTransactionID, this.m_dTotal);
    localPaymentInfoMagcard.m_sAuthorization = this.m_sAuthorization;
    localPaymentInfoMagcard.m_sErrorMessage = this.m_sErrorMessage;
    return localPaymentInfoMagcard;
  }

  public String getName()
  {
    return "magcard";
  }

  public double getTotal()
  {
    return this.m_dTotal;
  }

  public boolean isPaymentOK()
  {
    return this.m_sAuthorization != null;
  }

  public String getHolderName()
  {
    return this.m_sHolderName;
  }

  public String getCardNumber()
  {
    return this.m_sCardNumber;
  }

  public String getExpirationDate()
  {
    return this.m_sExpirationDate;
  }

  public String getTransactionID()
  {
    return this.m_sTransactionID;
  }

  public String getTrack1(boolean paramBoolean)
  {
    return paramBoolean ? this.track1 : this.track1.substring(1, this.track1.length() - 2);
  }

  public String getTrack2(boolean paramBoolean)
  {
    return paramBoolean ? this.track2 : this.track2.substring(1, this.track2.length() - 2);
  }

  public String getTrack3(boolean paramBoolean)
  {
    return paramBoolean ? this.track3 : this.track3.substring(1, this.track3.length() - 2);
  }

  public String getAuthorization()
  {
    return this.m_sAuthorization;
  }

  public String getMessage()
  {
    return this.m_sErrorMessage;
  }

  public void paymentError(String paramString1, String paramString2)
  {
    this.m_sAuthorization = null;
    this.m_sErrorMessage = (paramString1 + "\n" + paramString2);
  }

  public void setReturnMessage(String paramString)
  {
    this.m_sReturnMessage = paramString;
  }

  public String getReturnMessage()
  {
    return this.m_sReturnMessage;
  }

  public void paymentOK(String paramString1, String paramString2, String paramString3)
  {
    this.m_sAuthorization = paramString1;
    this.m_sTransactionID = paramString2;
    this.m_sReturnMessage = paramString3;
    this.m_sErrorMessage = null;
  }

  public String printCardNumber()
  {
    if (this.m_sCardNumber.length() > 4)
      return this.m_sCardNumber.substring(0, this.m_sCardNumber.length() - 4).replaceAll(".", "*") + this.m_sCardNumber.substring(this.m_sCardNumber.length() - 4);
    return "****";
  }

  public String printExpirationDate()
  {
    return this.m_sExpirationDate;
  }

  public String printAuthorization()
  {
    return this.m_sAuthorization;
  }

  public String printTransactionID()
  {
    return this.m_sTransactionID;
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.payment.PaymentInfoMagcard
 * JD-Core Version:    0.6.0
 */